home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Documents / Other / KBNS.verification.32.1 / KBNS.32.0.029 / theTest.m < prev   
Text File  |  1994-01-13  |  2KB  |  51 lines

  1. #import <appkit/appkit.h>
  2.  
  3. #define SimpleSubClass(CLASS, SUBCLASS)                                  \
  4.                                                                          \
  5.     @interface SUBCLASS:CLASS   {   @public int     x;      }   @end     \
  6.     @implementation SUBCLASS                                             \
  7.             - init                                                       \
  8.             {                                                            \
  9.                 self = [super  init];   x = 100;    return self;         \
  10.             }                                                            \
  11.     @end
  12.  
  13. #define PrintOut(SUBCLASS)                                               \
  14.             {                                                            \
  15.                 SUBCLASS    *b, *a = [[SUBCLASS  alloc]  init];          \
  16.                                                                          \
  17.                 b = [a  copy];                                           \
  18.                 printf("%17s = %d\tCopy = %d\n", [a  name], a->x, b->x); \
  19.             }
  20.  
  21. SimpleSubClass(List, List_x)
  22. SimpleSubClass(Storage, Storage_x)
  23. SimpleSubClass(Object, Object_x)
  24. SimpleSubClass(View, View_x)
  25. SimpleSubClass(Control, Control_x)
  26. SimpleSubClass(HashTable, HashTable_x)
  27. SimpleSubClass(NXBundle, NXBundle_x)
  28. SimpleSubClass(Cell, Cell_x)
  29. SimpleSubClass(NXData, NXData_x)
  30. SimpleSubClass(NXStringTable, NXStringTable_x)
  31. SimpleSubClass(ButtonCell, ButtonCell_x)
  32.  
  33. int main(int argc,char argv[]){
  34.   printf("%s\n","TEST: All values should equal 100");
  35.  
  36.   PrintOut(List_x);
  37.   PrintOut(Object_x);
  38.   PrintOut(Storage_x)
  39.   PrintOut(View_x)
  40.   PrintOut(Control_x)
  41.   PrintOut(HashTable_x)
  42.   PrintOut(NXBundle_x)
  43.   PrintOut(Cell_x)
  44.   PrintOut(NXData_x)
  45.   PrintOut(NXStringTable_x)
  46.   PrintOut(ButtonCell_x)
  47.  
  48.   printf("\n");
  49.   exit(0);
  50.   }
  51.